home *** CD-ROM | disk | FTP | other *** search
/ Dos/V Magazine 1995 October 15 / CD [VMAG951015].bin / _demo / w95demo / shared.dir / 00379_MENU SCRIPTS.ls < prev    next >
Encoding:
Text File  |  1995-08-22  |  7.5 KB  |  238 lines

  1. on doStartMenu menuItemToSelect
  2.   global gStartButtonDown, gCurrSubMenu, gCurrMainHiPos, gPromptV
  3.   if voidp(gStartButtonDown) then
  4.     set gStartButtonDown to 0
  5.   end if
  6.   if gStartButtonDown = 1 then
  7.     set gStartButtonDown to 0
  8.     exit
  9.   end if
  10.   set gCurrSubMenu to EMPTY
  11.   puppetSprite(29, 1)
  12.   puppetSprite(30, 1)
  13.   puppetSprite(31, 1)
  14.   puppetSprite(32, 1)
  15.   puppetSprite(33, 1)
  16.   puppetSprite(37, 1)
  17.   set inc to 22
  18.   set the castNum of sprite 29 to the castNum of sprite 29 + 1
  19.   set the locH of sprite 30 to 320
  20.   set the locV of sprite 30 to 240
  21.   set the locH of sprite 37 to 214
  22.   set the castNum of sprite 37 to cast "point left.pict"
  23.   if menuItemToSelect contains "prog" then
  24.     set gPromptV to 250
  25.   else
  26.     if menuItemToSelect contains "doc" then
  27.       set gPromptV to 280
  28.     else
  29.       if menuItemToSelect contains "set" then
  30.         set gPromptV to 310
  31.       else
  32.         if menuItemToSelect contains "find" then
  33.           set gPromptV to 340
  34.         else
  35.           if menuItemToSelect contains "help" then
  36.             set gPromptV to 370
  37.           else
  38.             if menuItemToSelect contains "run" then
  39.               set gPromptV to 400
  40.             else
  41.               if menuItemToSelect contains "shut" then
  42.                 set gPromptV to 430
  43.               end if
  44.             end if
  45.           end if
  46.         end if
  47.       end if
  48.     end if
  49.   end if
  50.   set the locV of sprite 37 to gPromptV
  51.   updateStage()
  52.   set lastHilite to EMPTY
  53.   set startMouse to the mouseUp
  54.   repeat while 1 = 1
  55.     doControl()
  56.     if rollOver(30) then
  57.       if (the mouseV > 235) and (the mouseV <= 265) then
  58.         set hilite to "prog"
  59.       else
  60.         if (the mouseV > 265) and (the mouseV <= 295) then
  61.           set hilite to "doc"
  62.         else
  63.           if (the mouseV > 295) and (the mouseV <= 325) then
  64.             set hilite to "set"
  65.           else
  66.             if (the mouseV > 325) and (the mouseV <= 355) then
  67.               set hilite to "find"
  68.             else
  69.               if (the mouseV > 355) and (the mouseV <= 385) then
  70.                 set hilite to "help"
  71.               else
  72.                 if (the mouseV > 385) and (the mouseV <= 415) then
  73.                   set hilite to "run"
  74.                 else
  75.                   if (the mouseV > 415) and (the mouseV <= 455) then
  76.                     set hilite to "shut"
  77.                   else
  78.                     set hilite to "blankHilite"
  79.                   end if
  80.                 end if
  81.               end if
  82.             end if
  83.           end if
  84.         end if
  85.       end if
  86.       set the castNum of sprite 31 to cast hilite
  87.       set the locH of sprite 31 to 320
  88.       set the locV of sprite 31 to 240
  89.       updateStage()
  90.       if the mouseUp <> startMouse then
  91.         if menuItemToSelect = hilite then
  92.           doCloseMenu()
  93.           goNext()
  94.           exit
  95.         end if
  96.       end if
  97.       if hilite <> lastHilite then
  98.         set lastHilite to hilite
  99.         set hiliteTimer to the ticks
  100.       else
  101.         if (the ticks - hiliteTimer) > 15 then
  102.           showSubMenu(hilite, menuItemToSelect, inc)
  103.         end if
  104.       end if
  105.       next repeat
  106.     end if
  107.     if rollOver(32) then
  108.       set the castNum of sprite 31 to cast gCurrSubMenu
  109.       set the locH of sprite 31 to 320
  110.       set the locV of sprite 31 to 240
  111.       updateStage()
  112.       set startMouse to the mouseUp
  113.       repeat while rollOver(32)
  114.         doControl()
  115.         set subTop to the top of sprite 32 + 4
  116.         if (the mouseV > subTop) and (the mouseV <= (subTop + inc)) then
  117.           set subHilite to "sub" & gCurrSubMenu & "1"
  118.         else
  119.           if (the mouseV > (subTop + inc)) and (the mouseV <= (subTop + (inc * 2))) then
  120.             set subHilite to "sub" & gCurrSubMenu & "2"
  121.           else
  122.             if (the mouseV > (subTop + (inc * 2))) and (the mouseV <= (subTop + (inc * 3))) then
  123.               set subHilite to "sub" & gCurrSubMenu & "3"
  124.             else
  125.               if (the mouseV > (subTop + (inc * 3))) and (the mouseV <= (subTop + (inc * 4))) then
  126.                 set subHilite to "sub" & gCurrSubMenu & "4"
  127.               else
  128.                 if (the mouseV > (subTop + (inc * 4))) and (the mouseV <= (subTop + (inc * 5))) then
  129.                   set subHilite to "sub" & gCurrSubMenu & "5"
  130.                 else
  131.                   if (the mouseV > (subTop + (inc * 5))) and (the mouseV <= (subTop + (inc * 6))) then
  132.                     set subHilite to "sub" & gCurrSubMenu & "6"
  133.                   else
  134.                     if (the mouseV > (subTop + (inc * 6))) and (the mouseV <= (subTop + (inc * 7))) then
  135.                       set subHilite to "sub" & gCurrSubMenu & "7"
  136.                     else
  137.                       if (the mouseV > (subTop + (inc * 7))) and (the mouseV <= (subTop + (inc * 8))) then
  138.                         set subHilite to "sub" & gCurrSubMenu & "8"
  139.                       else
  140.                         set subHilite to "blankHilite"
  141.                       end if
  142.                     end if
  143.                   end if
  144.                 end if
  145.               end if
  146.             end if
  147.           end if
  148.         end if
  149.         set the castNum of sprite 33 to cast subHilite
  150.         set the locH of sprite 33 to 320
  151.         set the locV of sprite 33 to 240
  152.         updateStage()
  153.         if the mouseUp <> startMouse then
  154.           if menuItemToSelect = subHilite then
  155.             doCloseMenu()
  156.             goNext()
  157.             exit
  158.           end if
  159.         end if
  160.       end repeat
  161.       set the castNum of sprite 33 to cast "blankHilite"
  162.       updateStage()
  163.       next repeat
  164.     end if
  165.     set subHilite to "blankHilite"
  166.     if gCurrSubMenu = EMPTY then
  167.       set the castNum of sprite 31 to cast "blankHilite"
  168.     end if
  169.     updateStage()
  170.     set startMouse to the mouseUp
  171.     repeat while not (rollOver(30) or rollOver(32))
  172.       doControl()
  173.       if the mouseUp <> startMouse then
  174.         if the mouseDown then
  175.           doCloseMenu()
  176.           exit
  177.           next repeat
  178.         end if
  179.         set startMouse to the mouseUp
  180.       end if
  181.     end repeat
  182.   end repeat
  183.   doCloseMenu()
  184. end
  185.  
  186. on doCloseMenu
  187.   global gStartButtonDown
  188.   if the mouseCast = the number of cast "start.btn.down" then
  189.     set gStartButtonDown to 1
  190.   else
  191.     set gStartButtonDown to 0
  192.   end if
  193.   puppetSprite(29, 0)
  194.   puppetSprite(30, 0)
  195.   puppetSprite(31, 0)
  196.   puppetSprite(32, 0)
  197.   puppetSprite(33, 0)
  198.   puppetSprite(37, 0)
  199.   updateStage()
  200. end
  201.  
  202. on showSubMenu subName, menuItemToSelect, inc
  203.   global gCurrSubMenu, gPromptV
  204.   set the locH of sprite 32 to -1000
  205.   set the locH of sprite 33 to -1000
  206.   if "prog doc set find" contains subName then
  207.     set the castNum of sprite 32 to cast ("sub" & subName)
  208.     set the locH of sprite 32 to 320
  209.     set the locV of sprite 32 to 240
  210.     set gCurrSubMenu to subName
  211.     updateStage()
  212.   else
  213.     set gCurrSubMenu to EMPTY
  214.   end if
  215.   if menuItemToSelect = subName then
  216.     set x to the right of sprite 31 + 48
  217.     set y to 370
  218.     set the castNum of sprite 37 to cast "prompt.pict"
  219.     set the locH of sprite 37 to x
  220.     set the locV of sprite 37 to y
  221.   else
  222.     if menuItemToSelect contains subName then
  223.       set x to the right of sprite 32 + 47
  224.       set linenum to value(char the number of chars in menuItemToSelect of menuItemToSelect)
  225.       set y to (linenum * inc) - (inc / 2) + the top of sprite 32
  226.       set the castNum of sprite 37 to cast "prompt.pict"
  227.       set the locH of sprite 37 to x
  228.       set the locV of sprite 37 to y
  229.     else
  230.       set the locH of sprite 37 to 214
  231.       set the castNum of sprite 37 to cast "point left.pict"
  232.       set the locV of sprite 37 to gPromptV
  233.     end if
  234.   end if
  235.   updateStage()
  236.   updateStage()
  237. end
  238.